<?php

Class Map extends CI_Controller{
    function __construct()
    {
        parent::__construct();
        $this->load->Model('sanpham_model');
        // $this->load->helper("url");
    }
    public function index(){
        $data['protes']  =$this->sanpham_model->getProductByCate('5,11');
        $data['protes1'] =$this->sanpham_model->getProductByCate('4,10');
        $data['protes2'] =$this->sanpham_model->getProductByCate('3,9');
        $data['category']=$this->sanpham_model->category(0);
        foreach($data['category'] as &$item) {
            $item['items'] = $this->sanpham_model->category($item['id']);
        }
        //echo "<pre>"; var_dump($data['category']);echo "</pre>";die;
        // echo "<pre>";var_dump($item['id']);;echo "</pre>";
        //$data['table'] = $this->sanpham_model->jointable($_GET['prent_id']);
        $data['table'] = $this->sanpham_model->jointable('prent_id');
        // $data['category']=$this->sanpham_model->category_id('catid');
        // var_dump($data['category']);
        /*
        echo "<pre>";
        print_r($data['table']);
        echo "<pre>";
        */
        //var_dump($item['name']) ;
        $this->load->view("map-view",$data);
    }
    function category() {

    }

}


?>